A gas sensor disposed in an exhaust pipe of an internal combustion engine and measures oxygen concentration and the like in an exhaust gas passing through the exhaust pipe is required to have responsiveness indicating the speed of measurement, water resistance indicating protection from moisture, and the like.
For example, Patent Document 1 discloses a gas sensor including a detection element, a main fitting for holding the detection element, and a protector for accommodating a detection part of the detection element. The protector has a large-diameter portion and a small-diameter portion. A first tip wall of the large-diameter portion is provided with a first depressed portion recessed toward a rear end side in an axial direction and a first opening portion opening in the first depressed portion. In addition, a second tip wall of the small-diameter portion is provided with a second depressed portion recessed toward the rear end side in the axial direction and a second opening portion opening in the second depressed portion. Then, even when water droplets infiltrate into the protector from the first opening portion or the second opening portion, water droplets adhere to the first depressed portion or the second depressed portion, thereby preventing the water droplets from adhering to the detecting element.